package smedi.ismedi.web.bff.infrastructure.constant;

/**
 * @author yangzhenzhou
 * @date 2022/11/15
 */
public class HiddenDangerField {
    /**
     * 隐患类型枚举
     */
    public enum HiddenDangerTypeEnum{
        /**
         * 一般
         */
        GENERIC("一般"),
        /**
         * 重大
         */
        SERIOUS("重大");

        private String name;
        HiddenDangerTypeEnum(String name){
            this.name = name;
        }
        public static String getName(String value) {
            for (HiddenDangerTypeEnum c : HiddenDangerTypeEnum.values()) {
                if (c.name().equals(value) ) {
                    return c.name;
                }
            }
            return null;
        }
        public static String getValue(String name) {
            for (HiddenDangerTypeEnum c : HiddenDangerTypeEnum.values()) {
                if (c.name.equals(name) ) {
                    return c.name();
                }
            }
            return null;
        }
    }
    /**
     * 隐患内容类型
     */
    public enum StatusEnum {

        BACK("BACK", "退回整改"),
        RECTIFICATION("RECTIFICATION", "待整改"),
        REVIEW("REVIEW", "待复查"),
        CLOSED("CLOSED", "已关闭"),
        FINISHED("FINISHED", "已完成");

        private String name;
        private String value;
        StatusEnum(String value, String name) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }

        public String getValue() {
            return value;
        }

        public static String getName(String value) {
            for (StatusEnum c : StatusEnum.values()) {
                if (c.getValue().equals(value) ) {
                    return c.name;
                }
            }
            return null;
        }

        public static String getValue(String name) {
            for (StatusEnum c : StatusEnum.values()) {
                if (c.getName().equals(name) ) {
                    return c.getValue();
                }
            }
            return null;
        }
        public static Boolean checkExistsFinishOrClose (String name) {
            for (StatusEnum item : StatusEnum.values()) {
                if(item.equals(FINISHED) || item.equals(CLOSED)) {
                    if (item.name == name) {
                        return true;
                    }
                }
            }
            return false;
        }
    }

    public enum OverStatusEnum{
        NORMAL("NORMAL","正常"),
        OVERCOMPLETE("OVERCOMPLETE","超期完成"),
        OVERUNFINISHED("OVERUNFINISHED","超期未完成"),
        OVERCLOSE("OVERCLOSE","超期关闭");
        private String name;
        private String value;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        OverStatusEnum(String value, String name) {
            this.name = name;
            this.value = value;
        }

        public static OverStatusEnum getOverStatusEnum (String value) {
            for (OverStatusEnum item : OverStatusEnum.values()) {
                if (item.getValue().equals(value) ) {
                    return item;
                }
            }
            return null;
        }

        public static String getName(String value) {
            for (OverStatusEnum c : OverStatusEnum.values()) {
                if (c.getValue().equals(value) ) {
                    return c.getName();
                }
            }
            return null;
        }
    }

    public enum CheckCharacterNum{
        PROJECT_CHECK("项目检查"),
        PARENT_CHECK("主体院检查"),
        HEADQUARTERS_CHECK("总院检查");

        private String name;
        CheckCharacterNum(String name){
            this.name = name;
        }

        public static String getName(String value) {
            for (CheckCharacterNum item : CheckCharacterNum.values()) {
                if (item.name().equals(value) ) {
                    return item.name;
                }
            }
            return null;
        }
    }
    public enum CheckTypeEnum {
        DAILY_CHECK("DAILY_CHECK","日常巡查"), //质量处为日常检查
        SPECIAL_CHECK("SPECIAL_CHECK","专项检查"),
        SAFE_ENGINEERING_CHECK("SAFE_ENGINEERING_CHECK","安全部、工程部检查"),
        PROJECT_WEEKLY_CHECK("PROJECT_WEEKLY_CHECK","项目周检"),
        SAFETY_CHECK_PROJECT_CHECK("SAFETY_CHECK_PROJECT_CHECK","项目检查（工程部检查）"),
        SAFETY_CHECK_ENGINEER_CHECK("SAFETY_CHECK_ENGINEER_CHECK","安全部、工程部检查"),
        SAFETY_CHECK_MAJOR_CHECK("SAFETY_CHECK_MAJOR_CHECK","项目检查（主体院检查）"),
        MONTH_CHECK("MONTH_CHECK","项目月检（主体院领导带班检查）"),
        SEASON_CHECK("SEASON_CHECK","季节性检查"),
        SPECIAL_INSPECTION("SPECIAL_INSPECTION","特殊性检查"),
        LEADERS_GENERAL_CHECK("LEADERS_GENERAL_CHECK","总院领导带班检查");


        private String name;
        private String value;
        CheckTypeEnum(String value, String name) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public static String getValue(String name) {
            for (CheckTypeEnum item : CheckTypeEnum.values()) {
                if (item.getName().equals(name) ) {
                    return item.value;
                }
            }
            return null;
        }

        public static String getName(String value) {
            for (CheckTypeEnum item : CheckTypeEnum.values()) {
                if (item.getValue().equals(value) ) {
                    return item.name;
                }
            }
            return null;
        }
    }

    public enum OperaTypeEnum {

        MY_CREATE("MY_CREATE","我创建的"),
        MY_RECTIFICATION("MY_RECTIFICATION","我整改的"),
        MY_REVIEW("MY_REVIEW","我复查的"),
        NOTIFY_ME("NOTIFY_ME","抄送我的");

        private String name;
        private String value;
        OperaTypeEnum(String value, String name) {
            this.name = name;
            this.value = value;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public static String getValue(String name) {
            for (OperaTypeEnum item : OperaTypeEnum.values()) {
                if (item.getName().equals(name) ) {
                    return item.value;
                }
            }
            return null;
        }

        public static String getName(String value) {
            for (OperaTypeEnum item : OperaTypeEnum.values()) {
                if (item.getValue().equals(value) ) {
                    return item.name;
                }
            }
            return null;
        }

        public static OperaTypeEnum getOperaTypeEnum (String value) {
            for (OperaTypeEnum item : OperaTypeEnum.values()) {
                if (item.getValue().equals(value) ) {
                    return item;
                }
            }
            return null;
        }
    }



}
